import request from '@/utils/request'

export function workshops() {
  return request({
    url: '/common/workshops',
    method: 'get'
  })
}

export function workshopsByRole() {
  return request({
    url: '/common/workshopsByRole',
    method: 'get'
  })
}

export function deviceByWorkshop(params) {
  return request({
    url: '/common/deviceInWorkshop',
    method: 'get',
    params: params
  })
}

// 设备状态占比
export function deviceUtilizationRate(roleId) {
  return request({
    url: '/board/deviceUtilizationRate/'+roleId,
    method: 'get'
  })
}

// 单台设备利用率
export function deviceUseRate(devId) {
  return request({
    url: '/board/deviceUseRate/'+devId,
    method: 'get'
  })
}

// 设备任务进度
export function deviceTaskProgress(devId) {
  return request({
    url: '/board/deviceTaskProgress/'+devId,
    method: 'get'
  })
}

// 设备任务达成率
export function deviceTaskCompleteRate(devId) {
  return request({
    url: '/board/deviceTaskCompleteRate/'+devId,
    method: 'get'
  })
}

// 设备任务信息
export function workshopTaskInfo(params) {
  return request({
    url: '/board/workshopTaskInfo',
    method: 'get',
    params: params
  })
}

// 待机设备
export function prepareDevices(params) {
  return request({
    url: '/board/prepareDevices',
    method: 'get',
    params: params
  })
}

// // 设备运行参数
// export function workshopDevRunParams(params) {
//   return request({
//     url: '/board/workshopDevRunParams',
//     method: 'get',
//     params: params
//   })
// }

// 当前设备运行参数
export function devRunParams(devId) {
  return request({
    url: '/board/devRunParams/'+devId,
    method: 'get'
  })
}

// 历史生产记录（近5个任务）
export function taskHisWithDev(devId) {
  return request({
    url: '/board/taskHisWithDev/'+devId,
    method: 'get'
  })
}

// 当月任务达成率
export function taskCompleteRate(devId) {
  return request({
    url: '/board/taskCompleteRate/'+devId,
    method: 'get'
  })
}

